<template>
  <div id="loginForm" class="loginForm">
    <h3 style="text-align: center">
      <slot name="formTitle">Login</slot>
    </h3>
    <el-form ref="form" :model="form" label-width="80px" @submit.native.prevent>
      <el-form-item label="Name" style="width: 80%">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="Password" style="width: 80%">
        <el-input v-model="form.password"></el-input>
      </el-form-item>
      <el-form-item>
        <slot id="submit"><el-button @click="login">Login</el-button> </slot>
        <el-button @click="doClose">Cancel</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "User",
  data() {
    return {
      form: {
        name: "admin",
        password: "123",
      },
    };
  },
  computed: {},
  methods: {
    login() {
      console.log("login");
    },
    doClose() {
      console.log("close");
    },
  },
};
</script>
